#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<vector<int>> ret;
    vector<vector<int>> subsets(vector<int>& nums) {
        ret.push_back(vector<int>());
        for (int i = 0; i < nums.size(); ++i)
        {
            dfs(nums, {}, i);
        }

        return ret;
    }

    void dfs(vector<int>& nums, vector<int> tmp, int i)
    {
        tmp.push_back(nums[i]);
        ret.push_back(tmp);
        if (i == nums.size() - 1)
        {
            return;
        }
        for (int j = i + 1; j < nums.size(); ++j)
            dfs(nums, tmp, j);
    }
};